<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>比较两个数的最大值</title>
</head>
<body>
    <script>
        //1.声明变量，输入数据
        var num1=Number(prompt('请输入一个数'));
        var num2=Number(prompt('请再输入一个数'));
        //2.比较两数大小
        var max=num1>num2 ? num1:num2;
        alert(max);
    </script>
</body>
</html>